.class Lcom/estrongs/android/pop/bt/a$b;
.super Les/wp0;
.source "OBEXFtpServer.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/estrongs/android/pop/bt/a;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "b"
.end annotation


# instance fields
.field private a:Ljava/util/Timer;

.field private b:Z

.field private c:Z

.field private d:Les/lp0;

.field private e:Ljava/lang/String;

.field private f:Ljava/lang/String;

.field private g:I

.field final synthetic h:Lcom/estrongs/android/pop/bt/a;


# direct methods
.method private constructor <init>(Lcom/estrongs/android/pop/bt/a;)V
    .locals 0

    .line 1
    iput-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-direct {p0}, Les/wp0;-><init>()V

    .line 2
    new-instance p1, Ljava/util/Timer;

    invoke-direct {p1}, Ljava/util/Timer;-><init>()V

    iput-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->a:Ljava/util/Timer;

    const/4 p1, 0x0

    .line 3
    iput-boolean p1, p0, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    .line 4
    iput-boolean p1, p0, Lcom/estrongs/android/pop/bt/a$b;->c:Z

    return-void
.end method

.method synthetic constructor <init>(Lcom/estrongs/android/pop/bt/a;Lcom/estrongs/android/pop/bt/a$a;)V
    .locals 0

    .line 5
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/bt/a$b;-><init>(Lcom/estrongs/android/pop/bt/a;)V

    return-void
.end method

.method private c()V
    .locals 0

    return-void
.end method


# virtual methods
.method public a(Les/tp0;Les/tp0;)I
    .locals 5

    const-string v0, "OBEXFtpServer"

    const-string v1, "OBEX onConnect"

    .line 9
    invoke-static {v0, v1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    const/16 v0, 0xa0

    if-nez p1, :cond_0

    return v0

    :cond_0
    const/16 v1, 0x46

    const/16 v2, 0xc0

    .line 10
    :try_start_0
    invoke-interface {p1, v1}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, [B

    if-nez p1, :cond_1

    goto :goto_0

    .line 11
    :cond_1
    iget-object v1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v1, p1}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;[B)Z

    move-result p1

    if-nez p1, :cond_2

    return v2

    :cond_2
    :goto_0
    const/16 p1, 0xcb

    .line 12
    new-instance v1, Ljava/lang/Long;

    iget v3, p0, Lcom/estrongs/android/pop/bt/a$b;->g:I

    int-to-long v3, v3

    invoke-direct {v1, v3, v4}, Ljava/lang/Long;-><init>(J)V

    invoke-interface {p2, p1, v1}, Les/tp0;->a(ILjava/lang/Object;)V

    const/16 p1, 0x4a

    .line 13
    invoke-static {}, Lcom/estrongs/android/pop/bt/a;->d()[B

    move-result-object v1

    invoke-interface {p2, p1, v1}, Les/tp0;->a(ILjava/lang/Object;)V

    const/4 p1, 0x1

    .line 14
    iput-boolean p1, p0, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    .line 15
    iget-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->a:Ljava/util/Timer;

    invoke-virtual {p1}, Ljava/util/Timer;->cancel()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    return v0

    :catch_0
    return v2
.end method

.method public a(Les/tp0;Les/tp0;ZZ)I
    .locals 6

    const-string p2, "/"

    const-string v0, "OBEXFtpServer"

    const-string v1, "OBEX onSetPath"

    .line 16
    invoke-static {v0, v1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 17
    iget-boolean v0, p0, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    if-nez v0, :cond_0

    const/16 p1, 0xa4

    return p1

    :cond_0
    if-eqz p3, :cond_1

    .line 18
    iget-object v0, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    iput-object v0, p0, Lcom/estrongs/android/pop/bt/a$b;->f:Ljava/lang/String;

    :cond_1
    const/16 v0, 0xcb

    const/16 v1, 0xc0

    .line 19
    :try_start_0
    invoke-interface {p1, v0}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    .line 20
    iget v0, p0, Lcom/estrongs/android/pop/bt/a$b;->g:I

    int-to-long v4, v0

    cmp-long v0, v2, v4

    if-eqz v0, :cond_2

    const/16 p1, 0xd3

    return p1

    :cond_2
    const/4 v0, 0x1

    .line 21
    invoke-interface {p1, v0}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/String;

    const/16 v0, 0xc4

    if-eqz p1, :cond_6

    .line 22
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v2

    if-nez v2, :cond_3

    goto :goto_0

    .line 23
    :cond_3
    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p3

    if-eqz p3, :cond_4

    .line 24
    iget-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {p1}, Lcom/estrongs/android/pop/bt/a;->c(Lcom/estrongs/android/pop/bt/a;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    goto :goto_1

    .line 25
    :cond_4
    new-instance p3, Ljava/lang/StringBuilder;

    invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v2, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    invoke-virtual {p3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    .line 26
    iget-object p2, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {p2, p1}, Lcom/estrongs/android/pop/bt/a;->c(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)Z

    move-result p2

    if-nez p4, :cond_5

    if-nez p2, :cond_5

    return v0

    .line 27
    :cond_5
    iput-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    if-eqz p4, :cond_9

    if-nez p2, :cond_9

    .line 28
    iget-object p2, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {p2, p1}, Lcom/estrongs/android/pop/bt/a;->d(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)Z

    goto :goto_1

    :cond_6
    :goto_0
    if-nez p3, :cond_7

    if-nez p4, :cond_7

    .line 29
    iget-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {p1}, Lcom/estrongs/android/pop/bt/a;->c(Lcom/estrongs/android/pop/bt/a;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    goto :goto_1

    :cond_7
    if-eqz p3, :cond_a

    if-nez p4, :cond_a

    .line 30
    iget-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {p1}, Lcom/estrongs/android/pop/bt/a;->c(Lcom/estrongs/android/pop/bt/a;)Ljava/lang/String;

    move-result-object p1

    iget-object p2, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_8

    return v0

    .line 31
    :cond_8
    iget-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    iget-object p2, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    invoke-static {p1, p2}, Lcom/estrongs/android/pop/bt/a;->b(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_9
    :goto_1
    const/16 p1, 0xa0

    return p1

    :catch_0
    :cond_a
    return v1
.end method

.method public a(Les/up0;)I
    .locals 13

    const-string v0, "OBEX onGet ends"

    const-string v1, "OBEXFtpServer"

    const-string v2, "OBEX onGet"

    .line 32
    invoke-static {v1, v2}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 33
    iget-boolean v2, p0, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    if-nez v2, :cond_0

    const/16 p1, 0xa4

    return p1

    :cond_0
    const/16 v2, 0xd3

    .line 34
    :try_start_0
    invoke-interface {p1}, Les/up0;->f()Les/tp0;

    move-result-object v3
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-nez v3, :cond_1

    const/16 p1, 0xc0

    .line 35
    invoke-static {v1, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return p1

    :cond_1
    const/16 v4, 0x42

    .line 36
    :try_start_1
    invoke-interface {v3, v4}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    const/4 v5, 0x1

    .line 37
    invoke-interface {v3, v5}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    const/16 v7, 0xcb

    .line 38
    invoke-interface {v3, v7}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/Long;

    invoke-virtual {v3}, Ljava/lang/Long;->longValue()J

    move-result-wide v8

    .line 39
    iget v3, p0, Lcom/estrongs/android/pop/bt/a$b;->g:I
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    int-to-long v10, v3

    cmp-long v3, v8, v10

    if-eqz v3, :cond_2

    .line 40
    invoke-static {v1, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return v2

    :cond_2
    const/16 v3, 0xa0

    const/4 v8, 0x0

    if-eqz v4, :cond_3

    :try_start_2
    const-string v9, "x-obex/folder-listing"

    .line 41
    invoke-virtual {v4, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 42
    iget-object v4, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v4}, Lcom/estrongs/android/pop/bt/a;->b(Lcom/estrongs/android/pop/bt/a;)Lcom/estrongs/bluetooth/parser/a;

    move-result-object v4

    iget-object v9, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    iget-object v10, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    .line 43
    invoke-static {v9, v10, v6}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;Ljava/lang/String;)Ljava/util/ArrayList;

    move-result-object v9

    .line 44
    invoke-virtual {v4, v9}, Lcom/estrongs/bluetooth/parser/a;->a(Ljava/util/ArrayList;)Ljava/lang/String;

    move-result-object v4

    .line 45
    invoke-virtual {v4}, Ljava/lang/String;->getBytes()[B

    move-result-object v4

    .line 46
    invoke-virtual {p0}, Les/wp0;->a()Les/tp0;

    move-result-object v9

    .line 47
    new-instance v10, Ljava/lang/Long;

    iget v11, p0, Lcom/estrongs/android/pop/bt/a$b;->g:I

    int-to-long v11, v11

    invoke-direct {v10, v11, v12}, Ljava/lang/Long;-><init>(J)V

    invoke-interface {v9, v7, v10}, Les/tp0;->a(ILjava/lang/Object;)V

    const/16 v7, 0xc3

    .line 48
    new-instance v10, Ljava/lang/Long;

    array-length v11, v4

    int-to-long v11, v11

    invoke-direct {v10, v11, v12}, Ljava/lang/Long;-><init>(J)V

    invoke-interface {v9, v7, v10}, Les/tp0;->a(ILjava/lang/Object;)V

    .line 49
    invoke-interface {v9, v5, v6}, Les/tp0;->a(ILjava/lang/Object;)V

    .line 50
    invoke-interface {p1, v9}, Les/up0;->b(Les/tp0;)V

    .line 51
    invoke-interface {p1}, Les/op0;->g()Ljava/io/DataOutputStream;

    move-result-object v5

    .line 52
    array-length v6, v4

    invoke-virtual {v5, v4, v8, v6}, Ljava/io/OutputStream;->write([BII)V

    .line 53
    invoke-virtual {v5}, Ljava/io/OutputStream;->flush()V

    .line 54
    invoke-virtual {v5}, Ljava/io/OutputStream;->close()V

    .line 55
    invoke-interface {p1}, Les/lp0;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 56
    invoke-static {v1, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return v3

    :cond_3
    if-nez v6, :cond_4

    .line 57
    :try_start_3
    invoke-interface {p1}, Les/up0;->f()Les/tp0;

    move-result-object v4

    const/16 v5, 0x49

    new-array v6, v8, [B

    .line 58
    invoke-interface {v4, v5, v6}, Les/tp0;->a(ILjava/lang/Object;)V

    .line 59
    invoke-interface {p1, v4}, Les/up0;->b(Les/tp0;)V

    .line 60
    invoke-interface {p1}, Les/lp0;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .line 61
    invoke-static {v1, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return v3

    .line 62
    :cond_4
    :try_start_4
    new-instance v4, Ljava/io/File;

    iget-object v5, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    invoke-direct {v4, v5, v6}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 63
    new-instance v5, Ljava/io/BufferedInputStream;

    new-instance v6, Ljava/io/FileInputStream;

    invoke-direct {v6, v4}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    const/high16 v4, 0x10000

    invoke-direct {v5, v6, v4}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;I)V

    .line 64
    new-instance v6, Ljava/io/BufferedOutputStream;

    .line 65
    invoke-interface {p1}, Les/op0;->h()Ljava/io/OutputStream;

    move-result-object v7

    invoke-direct {v6, v7, v4}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;I)V

    new-array v7, v4, [B

    .line 66
    :goto_0
    invoke-virtual {v5, v7, v8, v4}, Ljava/io/BufferedInputStream;->read([BII)I

    move-result v9

    const/4 v10, -0x1

    if-eq v9, v10, :cond_5

    .line 67
    invoke-virtual {v6, v7, v8, v9}, Ljava/io/BufferedOutputStream;->write([BII)V

    goto :goto_0

    .line 68
    :cond_5
    invoke-virtual {v6}, Ljava/io/BufferedOutputStream;->flush()V

    .line 69
    invoke-virtual {v5}, Ljava/io/BufferedInputStream;->close()V

    .line 70
    invoke-virtual {v6}, Ljava/io/BufferedOutputStream;->close()V

    .line 71
    invoke-interface {p1}, Les/lp0;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    .line 72
    invoke-static {v1, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return v3

    :catchall_0
    move-exception p1

    goto :goto_1

    :catch_0
    move-exception p1

    :try_start_5
    const-string v3, "OBEX Server onGet error"

    .line 73
    invoke-static {v1, v3, p1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    .line 74
    invoke-static {v1, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return v2

    :goto_1
    invoke-static {v1, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 75
    goto :goto_3

    :goto_2
    throw p1

    :goto_3
    goto :goto_2
.end method

.method public a(Les/lp0;I)V
    .locals 2

    const-string v0, "OBEXFtpServer"

    const-string v1, "Received OBEX connection"

    .line 1
    invoke-static {v0, v1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    const-string v1, "Client connected"

    invoke-static {v0, v1}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)V

    .line 3
    iput-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->d:Les/lp0;

    .line 4
    iput p2, p0, Lcom/estrongs/android/pop/bt/a$b;->g:I

    .line 5
    iget-boolean p1, p0, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    if-nez p1, :cond_0

    .line 6
    iget-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->a:Ljava/util/Timer;

    new-instance p2, Lcom/estrongs/android/pop/bt/a$b$a;

    invoke-direct {p2, p0}, Lcom/estrongs/android/pop/bt/a$b$a;-><init>(Lcom/estrongs/android/pop/bt/a$b;)V

    const-wide/32 v0, 0xea60

    invoke-virtual {p1, p2, v0, v1}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V

    .line 7
    :cond_0
    invoke-static {}, Lcom/estrongs/android/pop/l;->L1()Lcom/estrongs/android/pop/l;

    move-result-object p1

    .line 8
    invoke-virtual {p1}, Lcom/estrongs/android/pop/l;->s()Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    return-void
.end method

.method public a([B)V
    .locals 2

    .line 76
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "OBEX AuthFailure "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    new-instance v1, Ljava/lang/String;

    invoke-direct {v1, p1}, Ljava/lang/String;-><init>([B)V

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string v0, "OBEXFtpServer"

    invoke-static {v0, p1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public b(Les/tp0;Les/tp0;)I
    .locals 6

    const-string v0, "/"

    const-string v1, "OBEXFtpServer"

    const-string v2, "OBEX onDelete"

    .line 7
    invoke-static {v1, v2}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 8
    iget-boolean v1, p0, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    if-nez v1, :cond_0

    const/16 p1, 0xa4

    return p1

    :cond_0
    const/16 v1, 0xcb

    .line 9
    :try_start_0
    invoke-interface {p1, v1}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Long;

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    .line 10
    iget v3, p0, Lcom/estrongs/android/pop/bt/a$b;->g:I

    int-to-long v3, v3

    cmp-long v5, v1, v3

    if-eqz v5, :cond_1

    const/16 p1, 0xd3

    return p1

    :cond_1
    const/4 v1, 0x1

    .line 11
    invoke-interface {p1, v1}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    if-eqz v1, :cond_5

    .line 12
    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    goto :goto_0

    .line 13
    :cond_2
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v3, p0, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 14
    iget-object v1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v1, v0}, Lcom/estrongs/android/pop/bt/a;->c(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_3

    const/16 p1, 0xc4

    return p1

    .line 15
    :cond_3
    iget-object v1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v1, v0}, Lcom/estrongs/android/pop/bt/a;->e(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)Z

    move-result p1
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    if-eqz p1, :cond_4

    const/16 p1, 0xa0

    return p1

    :cond_4
    const/16 p1, 0xc3

    return p1

    :cond_5
    :goto_0
    const/16 p1, 0xc0

    return p1

    .line 16
    :catch_0
    invoke-super {p0, p1, p2}, Les/wp0;->b(Les/tp0;Les/tp0;)I

    move-result p1

    return p1
.end method

.method public b(Les/up0;)I
    .locals 16

    move-object/from16 v1, p0

    const-string v2, "OBEX onPut ends"

    const-string v3, "OBEXFtpServer"

    const-string v0, "OBEX onPut"

    .line 17
    invoke-static {v3, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 18
    iget-boolean v0, v1, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    if-nez v0, :cond_0

    const/16 v0, 0xa4

    return v0

    :cond_0
    const/16 v4, 0xd3

    .line 19
    :try_start_0
    invoke-interface/range {p1 .. p1}, Les/up0;->f()Les/tp0;

    move-result-object v0

    const/16 v5, 0xcb

    .line 20
    invoke-interface {v0, v5}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/Long;

    invoke-virtual {v5}, Ljava/lang/Long;->longValue()J

    move-result-wide v5

    .line 21
    iget v7, v1, Lcom/estrongs/android/pop/bt/a$b;->g:I
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    int-to-long v7, v7

    cmp-long v9, v5, v7

    if-eqz v9, :cond_1

    .line 22
    :goto_0
    invoke-static {v3, v2}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 23
    iget-object v0, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v0}, Lcom/estrongs/android/pop/bt/a;->d(Lcom/estrongs/android/pop/bt/a;)Lcom/estrongs/android/pop/bt/b;

    move-result-object v0

    invoke-interface {v0}, Lcom/estrongs/android/pop/bt/b;->a()V

    return v4

    :cond_1
    const/4 v5, 0x1

    .line 24
    :try_start_1
    invoke-interface {v0, v5}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    if-eqz v6, :cond_2

    .line 25
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    const-string v8, "name:"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v3, v7}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 26
    iget-object v7, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    const-string v9, "Receiving "

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-static {v7, v8}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)V

    goto :goto_1

    .line 27
    :cond_2
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "bt_received.tmp"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v7

    invoke-virtual {v6, v7, v8}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    .line 28
    iget-object v7, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    const-string v8, "Receiving file"

    invoke-static {v7, v8}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)V

    :goto_1
    const/16 v7, 0xc3

    .line 29
    invoke-interface {v0, v7}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    const/4 v7, 0x0

    if-eqz v0, :cond_3

    .line 30
    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    const-string v9, "file lenght:"

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-static {v3, v8}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 31
    iget-object v8, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v8}, Lcom/estrongs/android/pop/bt/a;->d(Lcom/estrongs/android/pop/bt/a;)Lcom/estrongs/android/pop/bt/b;

    move-result-object v8

    invoke-interface {v8, v7}, Lcom/estrongs/android/pop/bt/b;->a(I)V

    .line 32
    iget-object v8, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v8}, Lcom/estrongs/android/pop/bt/a;->d(Lcom/estrongs/android/pop/bt/a;)Lcom/estrongs/android/pop/bt/b;

    move-result-object v8

    invoke-virtual {v0}, Ljava/lang/Long;->intValue()I

    move-result v9

    invoke-interface {v8, v9}, Lcom/estrongs/android/pop/bt/b;->b(I)V

    .line 33
    :cond_3
    new-instance v8, Ljava/io/File;

    iget-object v9, v1, Lcom/estrongs/android/pop/bt/a$b;->e:Ljava/lang/String;

    invoke-direct {v8, v9, v6}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 34
    invoke-virtual {v8}, Ljava/io/File;->exists()Z

    move-result v9

    if-nez v9, :cond_4

    .line 35
    invoke-virtual {v8}, Ljava/io/File;->createNewFile()Z

    .line 36
    :cond_4
    new-instance v9, Ljava/io/BufferedOutputStream;

    new-instance v10, Ljava/io/FileOutputStream;

    invoke-direct {v10, v8}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    const/high16 v11, 0x10000

    invoke-direct {v9, v10, v11}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;I)V

    .line 37
    new-instance v10, Ljava/io/BufferedInputStream;

    .line 38
    invoke-interface/range {p1 .. p1}, Les/np0;->a()Ljava/io/InputStream;

    move-result-object v12

    invoke-direct {v10, v12, v11}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;I)V

    new-array v12, v11, [B

    const/4 v13, 0x0

    .line 39
    :cond_5
    :goto_2
    iget-object v14, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v14}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;)Z

    move-result v14

    if-nez v14, :cond_7

    .line 40
    invoke-virtual {v10, v12, v7, v11}, Ljava/io/BufferedInputStream;->read([BII)I

    move-result v14

    const/4 v15, -0x1

    if-ne v14, v15, :cond_6

    const-string v0, "EOS received"

    .line 41
    invoke-static {v3, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_3

    .line 42
    :cond_6
    invoke-virtual {v9, v12, v7, v14}, Ljava/io/BufferedOutputStream;->write([BII)V

    add-int/2addr v13, v14

    if-eqz v0, :cond_5

    .line 43
    rem-int/lit8 v14, v13, 0x64

    if-nez v14, :cond_5

    .line 44
    iget-object v14, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v14}, Lcom/estrongs/android/pop/bt/a;->d(Lcom/estrongs/android/pop/bt/a;)Lcom/estrongs/android/pop/bt/b;

    move-result-object v14

    invoke-interface {v14, v13}, Lcom/estrongs/android/pop/bt/b;->a(I)V

    goto :goto_2

    .line 45
    :cond_7
    :goto_3
    invoke-virtual {v9}, Ljava/io/BufferedOutputStream;->flush()V

    .line 46
    invoke-virtual {v9}, Ljava/io/BufferedOutputStream;->close()V

    .line 47
    invoke-interface/range {p1 .. p1}, Les/lp0;->close()V

    .line 48
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "file saved:"

    invoke-virtual {v0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v3, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 49
    iget-object v0, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    const-string v8, "Received "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v0, v6}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)V

    .line 50
    iput-boolean v5, v1, Lcom/estrongs/android/pop/bt/a$b;->c:Z

    .line 51
    invoke-direct/range {p0 .. p0}, Lcom/estrongs/android/pop/bt/a$b;->c()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    const/16 v0, 0xa0

    .line 52
    invoke-static {v3, v2}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 53
    iget-object v2, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v2}, Lcom/estrongs/android/pop/bt/a;->d(Lcom/estrongs/android/pop/bt/a;)Lcom/estrongs/android/pop/bt/b;

    move-result-object v2

    invoke-interface {v2}, Lcom/estrongs/android/pop/bt/b;->a()V

    return v0

    :catchall_0
    move-exception v0

    goto :goto_4

    :catch_0
    move-exception v0

    :try_start_2
    const-string v5, "OBEX Server onPut error"

    .line 54
    invoke-static {v3, v5, v0}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto/16 :goto_0

    .line 55
    :goto_4
    invoke-static {v3, v2}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 56
    iget-object v2, v1, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    invoke-static {v2}, Lcom/estrongs/android/pop/bt/a;->d(Lcom/estrongs/android/pop/bt/a;)Lcom/estrongs/android/pop/bt/b;

    move-result-object v2

    invoke-interface {v2}, Lcom/estrongs/android/pop/bt/b;->a()V

    .line 57
    goto :goto_6

    :goto_5
    throw v0

    :goto_6
    goto :goto_5
.end method

.method public b()V
    .locals 2

    const-string v0, "OBEXFtpServer"

    const-string v1, "OBEX notConnectedClose"

    .line 1
    invoke-static {v0, v1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 2
    iget-boolean v1, p0, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    if-nez v1, :cond_0

    const-string v1, "OBEX connection timeout"

    .line 3
    invoke-static {v0, v1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 4
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/pop/bt/a$b;->d:Les/lp0;

    invoke-interface {v0}, Les/lp0;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    nop

    .line 5
    :goto_0
    iget-boolean v0, p0, Lcom/estrongs/android/pop/bt/a$b;->c:Z

    if-nez v0, :cond_0

    .line 6
    iget-object v0, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    const-string v1, "Disconnected"

    invoke-static {v0, v1}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)V

    :cond_0
    return-void
.end method

.method public c(Les/tp0;Les/tp0;)V
    .locals 0

    const-string p1, "OBEXFtpServer"

    const-string p2, "OBEX onDisconnect"

    .line 1
    invoke-static {p1, p2}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 2
    iget-boolean p1, p0, Lcom/estrongs/android/pop/bt/a$b;->c:Z

    if-nez p1, :cond_0

    .line 3
    iget-object p1, p0, Lcom/estrongs/android/pop/bt/a$b;->h:Lcom/estrongs/android/pop/bt/a;

    const-string p2, "Disconnected"

    invoke-static {p1, p2}, Lcom/estrongs/android/pop/bt/a;->a(Lcom/estrongs/android/pop/bt/a;Ljava/lang/String;)V

    :cond_0
    const/4 p1, 0x0

    .line 4
    iput-boolean p1, p0, Lcom/estrongs/android/pop/bt/a$b;->b:Z

    return-void
.end method
